import java.util.ArrayList;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        ArrayList<Character> arrayList = new ArrayList<>();
        // 注意 hasNext 和 hasNextLine 的区别
        String str = in.nextLine();
        int n = in.nextInt();
        Double count = 0.0;
        for (int left = 0,right = 0; right < str.length() - 1;right++) {
            char c = str.charAt(right);
            if(c == 'C' || c == 'G'){
                count = Math.max(count,(count+1) / 5);
            }
            if(right - left < n){
                arrayList.add(c);
            }else {
                if(str.charAt(left) == 'C'|| str.charAt(left) == 'G' ){

                }
            }
        }
    }
}